<%@ page language="java" import="java.util.*" pageEncoding="Utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加管理员</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/common/style/base.css" type="text/css" media="screen" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/common/style/page.css" type="text/css" media="screen" />
<script src="${pageContext.request.contextPath}/common/js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/common/js/common.js" type="text/javascript"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/common/js/formvalidator.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/common/js/formvalidatorregex.js"></script>
<script type="text/javascript">
	$(function(){

		$.formValidator.initConfig({formid:"form",autotip:true});
		$("#loginName").formValidator({onshow:"请输入用户名",onfocus:"用户名应该为2-20位之间"}).inputValidator({min:2,max:20,onerror:"用户名应该为2-20位之间"}).regexValidator({regexp:"notempty",datatype:"enum",onerror:"请输入用户名"})
		.ajaxValidator({
		datatype : "json",
		async : false,
		type:"post",
		url : "${pageContext.request.contextPath}/checkAddmin.action",
		success : function(data){
			if(data.success) return true;
	        return false;
		},
		onerror : "该用户名已存在，请更换",
		onWait : "正在验证用户名，请稍候..."
		});
		$("#password").formValidator({onshow:"请输入密码",onfocus:"密码应该为6-20位之间"}).inputValidator({min:6,max:20,onerror:"密码应该为6-20位之间"});
		$("#repassword").formValidator({onshow:"请输入确认密码",onfocus:"请输入两次密码不同。",oncorrect:"密码输入一致"}).compareValidator({desid:"password",operateor:"=",onerror:"请输入两次密码不同。"});
	})
</script>
<script type="text/javascript">

</script>
</head>
<body>
<div class="pd10">	
	<div class="listbox">
		<form id="form" action="${pageContext.request.contextPath}/saveAdmin.action" method="post">
			<div>
				<table class="addtab"  align="left">
					<tr>
						<th>用户名</th>
						<td><input type="text" class="tx6" name="admin.loginName" title="请输入用户名" id="loginName"/></td>
					</tr>
					<tr>
						<th>密码</th>
						<td><input type="password" class="tx6" title="请输入密码" id="password"/></td>
					</tr>	
					<tr>
						<th>确认密码</th>
						<td><input type="password" class="tx6" name="admin.password"  title="请输入确认密码" id="repassword"/></td>
					</tr>		
								
				</table>
			</div>
			<div class="hidden">
				<input id="addsubmit" type="submit"/>
			</div>
		</form>
	</div>
</div>
</body>
</html>